﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package com.fminutes.vinciLib.utils {
    import flash.net.*;

    public class SharedObjectUtil {

        private static const FM_DIR:String = "fmDir";
        private static const FM_SHARE_OBJ:SharedObject = SharedObject.getLocal(FM_DIR);

        private static var sharedObject:SharedObject;

        public function SharedObjectUtil(){
            this.init();
        }
        public static function creatSharedObject(_arg1:String):SharedObject{
            return (SharedObject.getLocal(_arg1));
        }
        public static function writeSharedObjectData(_arg1:String, _arg2:String, _arg3):void{
            var name:* = _arg1;
            var key:* = _arg2;
            var data:* = _arg3;
            sharedObject = SharedObject.getLocal(name);
            sharedObject.data[key] = data;
            try {
                sharedObject.flush(1000);
            } catch(e:Error) {
            };
        }
        public static function readSharedObjectData(_arg1:String, _arg2:String):Object{
            sharedObject = SharedObject.getLocal(_arg1);
            return (sharedObject.data[_arg2]);
        }
        public static function fmWriteSharedObject(_arg1:String, _arg2:String):void{
            var key:* = _arg1;
            var url:* = _arg2;
            var sharedObj:* = SharedObject.getLocal(FM_DIR);
            sharedObj.data[key] = url;
            try {
                sharedObj.flush(1000);
            } catch(e:Error) {
            };
        }
        public static function fmReadSharedObject(_arg1:String):String{
            var _local4:String;
            var _local2:Object = FM_SHARE_OBJ.data;
            var _local3 = "";
            for (_local4 in _local2) {
                if (_local4 == _arg1){
                    _local3 = _local2[_arg1];
                };
            };
            return (_local3);
        }

        private function init():void{
        }
        public function getSharedObjectData(_arg1:String):Object{
            sharedObject = SharedObject.getLocal(_arg1);
            return (sharedObject.data);
        }

    }
}//package com.fminutes.vinciLib.utils 
